<?php

$backend = dirname(dirname(__FILE__));
$frontend = dirname($backend);
Yii::setPathOfAlias('backend', $backend);
Yii::setPathOfAlias('root', dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..');

/**
 *  This is the main administration configuration. 
 */
return array(
    'id' => 'pricemon',
    'basePath' => $frontend,
    'controllerPath' => $backend . '/controllers',
    'viewPath' => $backend . '/views',
    'runtimePath' => $frontend . '/runtime',
    'defaultController' => 'app/home',
    // preloading 'log' component
    'preload' => array('log'),
    'import' => array(
        'application.models.*',
        'application.components.*',
        'application.extensions.*',
        'backend.models.*',
        'backend.components.*',
    ),
    'timeZone' => 'Asia/Manila',
    // application components
    'components' => array(
        'user' => array(
            'class' => 'application.components.WebUser',
            // enable cookie-based authentication
            'allowAutoLogin' => false,
            'loginUrl' => array('app/login'),
        ),
        // uncomment the following to use a MySQL database
        'db' => require($frontend . '/config/db.php'),
        'errorHandler' => array(
            // use 'app/error' action to display errors
            'errorAction' => 'app/error',
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error, warning',
                ),
            // uncomment the following to show log messages on web pages
            /*
              array(
              'class'=>'CWebLogRoute',
              ),
             */
            ),
        ),
        'cache' => array(
            'class' => 'system.caching.CFileCache',
        ),
        'settings' => array(
            'class' => 'application.components.ApplicationConfiguration',
            'cacheTime' => 0,
        ),
        'clientScript' => array(
            'class' => 'CClientScript',
            'coreScriptPosition' => CClientScript::POS_END,
            'packages' => array(
                'bootstrap-min' => array(
                    'basePath' => 'root.js',
                    'js' => array('bootstrap.min.js'),
                    'depends' => array('jquery'),
                ),
            ),
        ),
    ),
);